<template>
	<view>
    <map
        v-if="show"
        id="map"
        :latitude="latitude"
        :longitude="longitude"
        :scale="scale"
        :markers="markers"
        show-location
        style="width: 100%; height: 100vh;">
    </map>

  </view>
</template>

<script>
	export default {
		data() {
			return {
        show: false,
        latitude: 39.9142,  // 地图中心点纬度
        longitude: 116.4074, // 地图中心点经度
        scale: 11, // 缩放级别，取值范围5-18
        markers: [],
        deviceList: []
			}
		},
		methods: {
			
		},
    onShow() {
      this.$api.memberList().then(res => {
        this.markers = res.filter(el => el.connect_id).map(el => {
          return {
            ...el.device,
            width: 25,
            height: 32,
            iconPath: '/static/location.png',
          }
        })
        this.show = true
      })
    }
	}
</script>

<style>

</style>
